<template>
  <div @click="onCancel">
    <form action="/">
      <van-search
        v-model="value"
        show-action
        placeholder="请输入搜索关键词"
        @cancel="onCancel"
      />
      <div class="hot">
        <span>热门搜索:</span>
        <span class="ic">周大福</span>
        <span class="ic">内衣</span>
        <span class="ic">Five Plus</span>
        <span class="ic">手机</span>
      </div>
    </form>
  </div>
</template>
<script>
import { Toast } from 'vant'

export default {
  data() {
    return {
      value: '',
    }
  },
  methods: {
    onCancel() {
      Toast('搜索')
      this.$router.push('search')
    },
  },
}
</script>
<style lang="less" scoped>
.hot {
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  padding: 1.3rem 1.1rem 0;
  font-size: 1.4rem;
  align-items: center;
  .ic {
    height: 2.6rem;
    line-height: 2.6rem;
    padding: 0 1.2rem;
    margin-right: 0.8rem;
    border-radius: 1.5rem;
    color: #272727;
    background-color: #f2f2f2;
  }
}
</style>
